<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<jsp:directive.page contentType="text/html" pageEncoding="UTF-8" />
<html xmlns:jsp="http://java.sun.com/JSP/Page">

<spring:url value="/browse" var="all_books"/>
<spring:url value="/browse/random" var="random"/>
<spring:url value="/browse/sorted" var="sorted_list"/>
<spring:url value="/rest_book/allbooks" var="rest_book_list"/>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Online library</title>
</head>
<body>
   <div>
	<jsp:include page="header.jsp" />
</div>
 <div id="centered">
	<br />
	<a href="${rest_book_list}">Get all books in xml</a>
	<br />

	<table id="hor-minimalist-a">
		<tr>
			<td><a href="${all_books}">Show all
					books</a></td>
			<td><a href="${sorted_list}">Show
					sorted books</a></td>
			<td><a href="${random}">Show
					random book</a></td>
		</tr>
	</table>
	<table id="box-table-a">
		<tr>
			<td>Number</td>
			<td>Title</td>
		</tr>
		<br/>
		<c:forEach var="book" items="${books}"
			varStatus="rowCounter">
			<spring:url value="/book/${book.title}" var="bookUrl"/>				
			<tr>
				<td>${rowCounter.count}</td>
				<td>${book.title}</td>
				<td><a href="${bookUrl}">Book
						details</a></td>
			</tr>
		</c:forEach>
	</table>
	</div>
</body>


</html>